﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="DMVeMayBay.aspx.cs" Inherits="Admin_DanhMuc_DMVeMayBay" %>

<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HomePlaceHolder" Runat="Server">
<div class="hrm_header_placeholder">
        Danh mục Vé máy bay</div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
    <div style="padding: 10px">
        <asp:HiddenField ID="H_CatalogId" Value="0" runat="server" />
        <asp:Panel ID="PanelAdd" Width="100%" GroupingText="Cập nhật thông tin" runat="server">
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="4" height="10">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="110" class="hrm_title_blue">
                    </td>
                    <td width="7" class="hrm_title_blue">
                    </td>
                    <td>
                        <asp:Label ID="lblStatus" ForeColor="Red" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Mã vé</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txtMaVe" CssClass="hrm_textbox" Width="205px" MaxLength="4" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" SetFocusOnError="True"
                            ControlToValidate="txtMaVe" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Điểm đi</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td width="400">
                        <asp:DropDownList ID="cboDiemDi" CssClass="hrm_combobox" Width="210px" runat="server">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="True"
                            InitialValue="0" ControlToValidate="cboDiemDi" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Điểm đến</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td width="400">
                        <asp:DropDownList ID="cboDiemDen" CssClass="hrm_combobox" Width="210px" runat="server">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="True"
                            InitialValue="0" ControlToValidate="cboDiemDen" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Quá cảnh</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txtQuaCanh" CssClass="hrm_textbox" Width="205px" MaxLength="25" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" SetFocusOnError="True"
                            ControlToValidate="txtQuaCanh" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Hãng máy bay</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td width="400">
                        <asp:DropDownList ID="cboHangMayBay" CssClass="hrm_combobox" Width="210px" runat="server">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" SetFocusOnError="True"
                            InitialValue="0" ControlToValidate="cboHangMayBay" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="130" class="hrm_title_blue">
                        Giá tiền</td>
                    <td width="7" class="hrm_title_blue">
                        :
                    </td>
                    <td>
                        <asp:TextBox ID="txtGia" CssClass="hrm_textbox" Width="205px" MaxLength="25" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" SetFocusOnError="True"
                            ControlToValidate="txtGia" Display="Dynamic" ErrorMessage=" (*)"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtGia" Display="Dynamic" ErrorMessage="Chỉ chấp nhận kiểu số" ValidationExpression="\d+"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                <td colspan="4" height="4">
                </td>
            </tr>
            <tr>
                <td width="20">
                </td>
                <td width="100" class="hrm_title_blue">
                    Trạng thái
                </td>
                <td width="7" class="hrm_title_blue">
                    :
                </td>
                <td>
                    <asp:CheckBox ID="chkTrangThai" Checked="true" runat="server" />
                </td>
            </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="4">
                    </td>
                </tr>
                <tr>
                    <td width="20">
                    </td>
                    <td width="110" class="hrm_title_blue">
                    </td>
                    <td width="7" class="hrm_title_blue">
                    </td>
                    <td>
                        <asp:ImageButton ID="cmdSave" ImageUrl="~/Images/save.jpg" runat="server" OnClick="cmdSave_Click" />
                        <asp:ImageButton ID="cmdReset" CausesValidation="false" ImageUrl="~/Images/huy.jpg"
                            runat="server" OnClick="cmdReset_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4" height="8">
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="PanelList" Width="100%" Height="355" GroupingText="Danh sách" runat="server">
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="20">
                    </td>
                    <td style="padding-right: 15px">
                        <asp:Panel ID="PanelGrid" Width="100%" runat="server">
                            <br />
                            <asp:GridView ID="gridCatalog" runat="server" DataKeyNames="MaVe" Width="100%" BackColor="White"
                                OnRowCommand="gridCatalog_RowCommand" OnRowDataBound="gridCatalog_RowDataBound"
                                OnRowDeleting="gridCatalog_RowDeleting" EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                                BorderColor="#CCCCCC" AutoGenerateColumns="false" BorderStyle="Solid" BorderWidth="1px"
                                CellPadding="3">
                                <Columns>
                                    <asp:BoundField DataField="id" Visible="false" HeaderText="id"></asp:BoundField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="7%" 
                                        HeaderText="Sửa">
                                     <ItemTemplate>
                                           <asp:ImageButton ID="cmdSelects" runat="server" CssClass="command_button" CausesValidation="false"
                                            CommandName="Select" ToolTip="Click để sửa" ImageUrl="~/Images/edit.png" CommandArgument='<%# Eval("MaVe") %>' />
                                     </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="7%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="7%" 
                                        HeaderText="Xóa">
                                        <ItemTemplate>
                                           <asp:ImageButton ID="cmdDelete" runat="server" CssClass="command_button" CausesValidation="false"
                                                        CommandName="Delete" ToolTip="Click để xóa" ImageUrl="~/Images/DeleteRed.png" CommandArgument='<%# Eval("MaVe") %>' />
                                     </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="7%" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="MaVe" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderText="Mã vé">
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Điểm đi"
                                        ItemStyle-Width="12%">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDiemDi" CssClass="ogiua" runat="server" Text='<%# GetDiemDi(Eval("IdDiemDi")) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Điểm đến"
                                        ItemStyle-Width="12%">
                                        <ItemTemplate>
                                            <asp:Label ID="lblDiemDen" CssClass="ogiua" runat="server" Text='<%# GetDiemDen(Eval("IdDiemDen")) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="QuaCanh" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%" HeaderText="Quá cảnh">
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="Hãng máy bay" HeaderStyle-HorizontalAlign="Center"
                                        ItemStyle-Width="13%">
                                        <ItemTemplate>
                                            <asp:Label ID="lblHangMayBay" CssClass="ogiua" runat="server" Text='<%# GetHangMayBay(Eval("IdHangMayBay")) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Gia" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" HeaderText="Giá tiền">
                                    </asp:BoundField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                        HeaderText="Ngày cập nhật" ItemStyle-Width="12%">
                                        <ItemTemplate>
                                            <asp:Label ID="LabelNgayCapNhat" runat="server" Text='<%# Convert.ToDateTime(Eval("NgayCapNhat")).ToString("dd/MM/yyyy")%>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Width="12%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                                            HeaderText="Đã đăng" ItemStyle-Width="13%">
                                            <ItemTemplate>
                                                <asp:Label ID="LabelTinNong" runat="server" Text='<%# (Eval("TrangThai").ToString())=="True" ? "<html><img src=../../Images/checkk.png /></html>" : "<html><img src=../../Images/redx.png /></html>"%>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="8%" />
                                        </asp:TemplateField>
                                </Columns>
                                <RowStyle ForeColor="#000066" />
                                <SelectedRowStyle BackColor="#dedfdf" Font-Bold="True" ForeColor="Gray" />
                                <HeaderStyle BackColor="#006699" Font-Bold="True" HorizontalAlign="Left" ForeColor="White" />
                            </asp:GridView>
                        </asp:Panel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" height="10">
                         <cc1:Pager ID="Pager1" runat="server" PreviousClause="" NextClause="" LastClause=""
                            FirstClause="" PageClause="Trang" OfClause="/" PageSize="10" OnCommand="Pager1_Command">
                        </cc1:Pager>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

